package com.whj;

import com.whj.client.NettyClient;
import com.whj.common.agreement.RpcRequest;
import com.whj.common.hello.Hello;

public class StartClient {
    public static void main(String[] args) throws Exception {
        Hello hello = (Hello) NettyClient.createProxy(Hello.class);

        RpcRequest rpcRequest = new RpcRequest();
        Object[] paramaters = {1,2,3};
        Class<?>[] parameterTypes = {String.class,String.class,String.class};
        rpcRequest.setClassName("xxx没啥用");// 没用
        rpcRequest.setParameters(paramaters);// 没用
        rpcRequest.setParameterTypes(parameterTypes);// 没用
        rpcRequest.setMethodName("xx");
        rpcRequest.setRequestId("helloImpl");


        while (true){
            hello.rpcAgreement(rpcRequest);
            Thread.sleep(2000);
        }
    }
}
